package com.gsezone;

import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;

public class BookStoreMain {

	public static void main(String[] args) {

		JFrame frame = new JFrame("Book Store");
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		frame.setSize(400, 200);

		JPanel p1 = new JPanel();
		frame.add(p1);

		final JLabel l1 = new JLabel();
		l1.setText("I am a label");
		p1.add(l1);

		final JTextField t1 = new JTextField();
		t1.setPreferredSize(new Dimension(100, 20));
		p1.add(t1);

		JButton b1 = new JButton("Submit");
		b1.addActionListener(new ActionListener() {

			@Override
			public void actionPerformed(ActionEvent e) {
				// TODO Auto-generated method stub

				l1.setText(t1.getText());

			}
		});
		p1.add(b1);

		frame.show();
	}

}
